<extend name="Home@Base/common" xmlns="http://www.w3.org/1999/html"/>
<block name="body">
    <div class="span9 page_message">
        <section id="contents"> <include file="Home@Addons/_nav" />
            <div class="tab-content">
                <php> $post_url || $post_url = U('ordermanage?model='.$model['id'], $get_param);</php>
                <form class="form-horizontal form-center" method="post" action="{$post_url}" id="form">
                    <div class="form-item cf" style="float: left">
                        <span style="font-weight: bold">查询条件: &nbsp&nbsp</span>
                        <span> 订单状态</span>
                        <select name="status" style="width: 120px;height: 26px;padding-top: 0px">
                            <volist name="status_sel" id="vo">
                                <option value="{$vo.id}" {$vo.selected}>{$vo.name}</option>
                            </volist>
                        </select>
                    </div>
                    <div class="form-item cf">
                        <button style="margin-left: 20px;width: 120px;height: 30px background-color: #327cd5; value='1' name="button_query">开始查询</button>
                    </div>
                    <div style="clear: left">
                        <hr>
                    </div>

                <table>
                    <thead><tr>
                        <volist name="table_name" id="vo" mode="5">
                            <th>{$vo}</th>
                        </volist>
                    </tr></thead>
                    <volist name="table_data" id="vo">
                        <tr>
                            <td>{$vo['order_no']}</td>
                            <td>{$vo['emp_name']}</td>
                            <td style="width: 200px">{$vo['product']}</td>
                            <td>{$vo['num']}</td>
                            <td>{$vo['total']}</td>
                            <td>{$vo['comment']}</td>
                            <td>{$vo['date']}</td>
                            <td>{$vo['status']}</td>
                            <td>{$vo['action']}</td>
                         </tr>
                    </volist>
                </table>
                <div class="page"> {$_page|default=''} </div>
                <div><input type="hidden" name="type" value="{$type}"></div>
                </form>
            </div>
        </section>
    </div>
</block>

<block name="style">
    <style type="text/css">
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 0 auto;
            text-align: center;
        }
        table td, table th {
            border: 0px solid #cad9ea;
            color: #666;
            height: 30px;
            text-align: center;
        }
        table thead th {
            background-color: #CCE8EB;
            width: 100px;
        }
        table tr:nth-child(odd) {
            background: #fff;
        }
        table tr:nth-child(even) {
            background: #F5FAFA;
        }
    </style>
</block>

<block name="script">
    <script type="text/javascript">
        $(function() {
            showTab();
        })
        function refusePrompt (url,content='') {
            var comment = prompt('请输入拒绝该订单原因：',content);
            if (comment === null) {
                console.log("取消");
            } else if (comment === '') {
                alert('请输入拒绝该订单原因，不能为空！！');
            }else {
                // console.log(url.slice(0,-5) + '/comment/'+comment);
                var reg = "/"+' '+"/g";
                var data = comment.replace(eval(reg),"　");
                window.location.href = url.slice(0,-5) + '/comment/'+data+'.html';
            }
        }
    </script>
</block>